﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Funnel_Chart
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            FarPoint.Win.Chart.FunnelSeries funnel = new FarPoint.Win.Chart.FunnelSeries();
            funnel.SeriesName = "Series0";
            funnel.Values.Add(200);
            funnel.Values.Add(180);
            funnel.Values.Add(50);
            funnel.Values.Add(30);
            funnel.Values.Add(8);
            funnel.CategoryNames.Add("Leads");
            funnel.CategoryNames.Add("Emails Sent");
            funnel.CategoryNames.Add("Replies");
            funnel.CategoryNames.Add("Quotes");
            funnel.CategoryNames.Add("Purchases");
            funnel.BarFills.AddRange(new FarPoint.Win.Chart.GradientFill[] { new FarPoint.Win.Chart.GradientFill(Color.LightGreen, Color.Yellow), new FarPoint.Win.Chart.GradientFill(Color.LightBlue, Color.Thistle), new FarPoint.Win.Chart.GradientFill(Color.LightGray, Color.LightPink), new FarPoint.Win.Chart.GradientFill(Color.Beige, Color.Orange), new FarPoint.Win.Chart.GradientFill(Color.LightSalmon, Color.RosyBrown) });
            funnel.BarBorders.AddRange(new FarPoint.Win.Chart.Line[] { new FarPoint.Win.Chart.SolidLine(Color.DarkOliveGreen), new FarPoint.Win.Chart.SolidLine(Color.DarkBlue), new FarPoint.Win.Chart.SolidLine(Color.Black), new FarPoint.Win.Chart.SolidLine(Color.DarkOrange), new FarPoint.Win.Chart.SolidLine(Color.Firebrick) });
            FarPoint.Win.Chart.YPlotArea plotArea = new FarPoint.Win.Chart.YPlotArea();
            plotArea.Location = new PointF(0.2f, 0.2f);
            plotArea.Size = new SizeF(0.6f, 0.6f);
            plotArea.XAxis.Reverse = true;
            plotArea.Vertical = false;
            plotArea.Series.Add(funnel);
            FarPoint.Win.Chart.ChartModel model = new FarPoint.Win.Chart.ChartModel();
            model.PlotAreas.Add(plotArea);
            FarPoint.Win.Spread.Chart.SpreadChart chart = new FarPoint.Win.Spread.Chart.SpreadChart();
            chart.Model = model;
            chart.Left = 0;
            chart.Top = 150;
            chart.Size = new Size(600, 400);
            fpSpread1.ActiveSheet.Charts.Add(chart);
            fpSpread1.Font = new System.Drawing.Font("Calibri", 11);
        }
    }
}
